import {Circle} from '@antv/g6';

class BreathingCircle extends Circle {
    onCreate() {
        this.animateMap.animate1 = (v) => {
            v.animate([{lineWidth: 0}, {lineWidth: 20}], {
                duration: 1000,
                iterations: Infinity,
                direction: 'alternate',
            });
        }
    }

    onUpdate() {
        const halo = this.shapeMap?.halo;
        if (halo) {
            this.animateMap.animate1(halo)
        }
    }
}

export default BreathingCircle;
